000100* $$FILECOMMENT$$ 
000200 IDENTIFICATION DIVISION.
000300  PROGRAM-ID. $$PROGRAMID$$.
000400*
000500 DATA DIVISION.
000600  WORKING-STORAGE SECTION.
000700  01  WORD-VALUES.
000800      02     PIC X(10) VALUE "apple".
000900      02     PIC X(10) VALUE "black".
001000      02     PIC X(10) VALUE "cobol".
001100      02     PIC X(10) VALUE "dog".
001200      02     PIC X(10) VALUE "eye".
001300      02     PIC X(10) VALUE "fault".
001400      02     PIC X(10) VALUE "good".
001500      02     PIC X(10) VALUE "high".
001600      02     PIC X(10) VALUE "idea".
001700      02     PIC X(10) VALUE "junior".
001800      02     PIC X(10) VALUE "king".
001900      02     PIC X(10) VALUE "love".
002000      02     PIC X(10) VALUE "medium".
002100      02     PIC X(10) VALUE "new".
002200      02     PIC X(10) VALUE "open".
002300      02     PIC X(10) VALUE "pig".
002400      02     PIC X(10) VALUE "queen".
002500      02     PIC X(10) VALUE "review".
002600      02     PIC X(10) VALUE "smile".
002700      02     PIC X(10) VALUE "tomorrow".
002800      02     PIC X(10) VALUE "understand".
002900      02     PIC X(10) VALUE "version".
003000      02     PIC X(10) VALUE "wood".
003100      02     PIC X(10) VALUE "xylophone".
003200      02     PIC X(10) VALUE "yesterday".
003300      02     PIC X(10) VALUE "zoo".
003400      02     PIC X(10) VALUE "**error**".
003500 01  WORD-TABLE REDEFINES  WORD-VALUES.
003600     02  WORD-ITEM OCCURS 27 TIMES.
003700         03  FIRST-CHARACTER PIC X.
003800         03                  PIC X(9).
003900 01  WORD-INDEX          PIC 9(3).
004000 01  INPUT-CHARACTER     PIC X.
004100 01  REQUEST-MESSAGE     PIC X(42)
004200     VALUE  "ENTER ONE CHARACTER OF ALPHABETIC-LOWER.=>".
004300*
004400 PROCEDURE DIVISION.
004500  DATA-INPUT  SECTION.
004600**(1)DISPLAY THE ABOVE MESSAGE
004700       DISPLAY REQUEST-MESSAGE WITH NO ADVANCING.
004800**(2)ACCEPT THE INPUT CHARACTER
004900       ACCEPT  INPUT-CHARACTER.
005000*
005100  SEARCH-WORD  SECTION.
005200**(3)WORDS ARE SEARCHED CORRESPONDING TO THE INPUT CHARACTER
005300       PERFORM TEST BEFORE
005400               VARYING WORD-INDEX FROM 1 BY 1
005500               UNTIL WORD-INDEX > 26
005600          IF INPUT-CHARACTER = FIRST-CHARACTER (WORD-INDEX)
005700            THEN EXIT PERFORM
005800           END-IF
005900        END-PERFORM.
006000*
006100  WORD-OUTPUT  SECTION.
006200**(4) THE RESULTING WORD MATCH IS DISPLAYED
006300       DISPLAY WORD-ITEM (WORD-INDEX).
006400*
006500       EXIT PROGRAM.
006600   END PROGRAM $$PROGRAMID$$.
